#!/bin/bash
set -o nounset                              # Treat unset variables as an error
echo '
set terminal epslatex color colortext
set output "tcp_dualreceive_andsend.tex"
 set title "Network speed with 2 TCP stream using 2 NICs"
  f(x) = mean_y
  fit f(x) "data/tcp_dualreceive_andsend.parsed" u 1:3 via mean_y
  set label 3 gprintf("Mean(Total) = %gMb/s", mean_y) at  150,15000
      set xlabel "Time(s)"
      set ylabel "Mb/s"
      plot "data/tcp_dualreceive_andsend.parsed" using 1:3 with line title "Total","data/tcp_dualreceive_andsend.parsed" using 1:9 with line title "Recv 1","data/tcp_dualreceive_andsend.parsed" using 1:10 with line title "Recv 2","data/tcp_dualreceive_andsend.parsed" using 1:11 with line title "Send 1","data/tcp_dualreceive_andsend.parsed" using 1:12 with line title "Send 2" ' |gnuplot -persist      
